<?php

namespace Home\Controller;

use Think\Controller;

class NotifyController extends Controller {

    public function pay() {
        $orders = explode(",", I('post.out_trade_no'));
        foreach ($orders as $v) {
            $info = M("order")->field("state")->where("id = '" . $v . "'")->find();
            if ($info['state'] == 0) {
                M("order")->where("id = '" . $v . "'")->save(array("state" => 1,"pay_time"=>time()));
            }
        }
    }
     public function pay_single() {
        $orders = explode(",", I('post.out_trade_no'));
        foreach ($orders as $v) {
            $info = M("order")->field("state")->where("ordernum = '" . $v . "'")->find();
            if ($info['state'] == 0) {
                M("order")->where("ordernum = '" . $v . "'")->save(array("state" => 1,"pay_time"=>time()));
            }
        }
    }
    

}

?>